<template>
    <div id="main">

    </div>
</template>

<script>
import E from 'wangeditor'
export default {
    data() {
        return {
            editor: {},
            //    content: ''
        }
    },
    mounted() {
        this.editor = new E('#main')
        this.editor.config.focus = false
        this.editor.config.onchange = (newHtml) => {
            // console.log(newHtml)
            // this.content = newHtml
            this.$emit('sendContent', newHtml)
        }
        this.editor.config.onchangeTimeout = 500;
        // this.editor.config.menus = ['bold', 'head', 'link', 'italic', 'underline']
        this.editor.create()
    }
}
</script>

<style>
.w-e-text-container{
    height: 120px !important;/*!important是重点，因为原div是行内样式设置的高度300px*/
}
</style>